package cn.edu.ctbu.myblog.service;

import cn.edu.ctbu.myblog.dao.CommentDAO;
import cn.edu.ctbu.myblog.dao.UserDAO;
import cn.edu.ctbu.myblog.domain.CommentDO;
import cn.edu.ctbu.myblog.domain.UserDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    UserDAO userDAO;

    public List<UserDO> getAll(){
        List<UserDO> userDOS=userDAO.findAll();
        return userDOS;
    }

    public List<UserDO> getById(int id){
        List<UserDO> userDOS=userDAO.findById(id);
        return userDOS;
    }

    public List<UserDO> findByNameAndPassword(String userName,String userPassword){
        List<UserDO> userDOS=userDAO.findByUserNameAndPassword(userName,userPassword);
        return userDOS;
    }

}
